package com.hongxin.doc.common.enums;

public enum ResultCodeEnum {
    /* 成功状态码 */
    SUCCESS(200, "成功"),

    WARNING(201, ""),

    /* 错误状态码 */
    NOT_FOUND(404, "请求的资源不存在"),

    UNAUTHORIZED(401, "请登录"),
    FORBIDDEN(403, "权限不足"),

    INTERNAL_ERROR(500, "服务器内部错误"),
    PARAMETER_EXCEPTION(501, "请求参数校验异常"),

    /* 业务状态码 */
    PARAM_ERROR(10000, "参数错误"),
    INSERT_ERROR(10001, "添加失败"),

    UPDATE_ERROR(10002, "更新失败"),

    REPEAT_ERROR(10003, "数据有重复"),

    NONEXISTENT_ERROR(10004, "数据不存在")
    ;

    private Integer code;
    private String message;

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    ResultCodeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
}
